package com.lantian.teacher.controller;

import com.lantian.common.result.Result;
import org.springframework.web.bind.annotation.*;

/**
 * @name:
 * @description:
 * @author: meet
 * @create: 2020-04-28 19:29
 */
@RestController
@RequestMapping("/user")
@CrossOrigin
public class UserCtrl {

    @PostMapping("/login")
    @ResponseBody
    public Result login(){
        return Result.ok().data("token","admin");
    }

    @GetMapping("/info")
    @ResponseBody
    public Result info(){
        //"data":{"roles":["admin"],"name":"admin",
        // "avatar":"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif"}}
        return Result.ok().data("roles","[\"admin\"]")
                .data("name","admin")
                .data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }



}